package com.sys.controller;

import com.entity.TokenEntity;
import com.sys.service.TokenService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description:
 */
@RestController
@RequestMapping("/token/")
public class TokenController {
    @Resource
    private TokenService tokenService;

    @GetMapping("getAccount")
    public TokenEntity getCurrentUserByToken(@RequestParam("token") String token) {
        return tokenService.getTokenEntity(token);
    }
}
